package cn.kailangtu.serialport;

public class CanBaudrate {
    public static String CAN_BAUDRATE_1000kbps = "0x00";
    public static String CAN_BAUDRATE_800kbps = "0x11";
    public static String CAN_BAUDRATE_500kbps = "0x22";
    public static String CAN_BAUDRATE_400kbps = "0x33";
    public static String CAN_BAUDRATE_250kbps = "0x44";
    public static String CAN_BAUDRATE_200kbps = "0x55";
    public static String CAN_BAUDRATE_125kbps = "0x66";
    public static String CAN_BAUDRATE_100kbps = "0x77";
    public static String CAN_BAUDRATE_50kbps = "0x88";
    public static String CAN_BAUDRATE_40kbps = "0x99";
    public static String CAN_BAUDRATE_25kbps = "0xAA";



    public static String getCanBaudrateString(String canBaudrate)
    {
        String result = "";
        switch(canBaudrate)
        {
            case "1000kbps":
                result = CAN_BAUDRATE_1000kbps;
                break;
            case "800kbps":
                result = CAN_BAUDRATE_800kbps;
                break;
            case "500kbps":
                result = CAN_BAUDRATE_500kbps;
                break;
            case "400kbps":
                result = CAN_BAUDRATE_400kbps;
                break;
            case "250kbps":
                result = CAN_BAUDRATE_250kbps;
                break;
            case "200kbps":
                result = CAN_BAUDRATE_200kbps;
                break;
            case "125kbps":
                result = CAN_BAUDRATE_125kbps;
                break;
            case "100kbps":
                result = CAN_BAUDRATE_100kbps;
                break;
            case "50kbps":
                result = CAN_BAUDRATE_50kbps;
                break;
            case "40kbps":
                result = CAN_BAUDRATE_40kbps;
                break;
            case "25kbps":
                result = CAN_BAUDRATE_25kbps;
                break;
        }


        return result;
    }
}
